import wx
import noname
class myFrame(noname.rootframe):
    def __init__(self,parent):
        noname.rootframe.__init__(self,parent=parent)
        self.Show()

        # 以下是鼠标点击事件
    def sevenclick(self, event):
        self.inputAndresult.AppendText('7')

    def eightclick(self, event):
        self.inputAndresult.AppendText('8')

    def nineclick(self, event):
        self.inputAndresult.AppendText('9')

    def fourclick(self, event):
        self.inputAndresult.AppendText('4')

    def fiveclick(self, event):
        self.inputAndresult.AppendText('5')

    def sixclick(self, event):
        self.inputAndresult.AppendText('6')

    def oneclick( self, event ):
        self.inputAndresult.AppendText('1')

    def twoclick(self, event):
        self.inputAndresult.AppendText('2')

    def threeclick(self, event):
        self.inputAndresult.AppendText('3')

    def zeroclick(self, event):
        self.inputAndresult.AppendText('0')

    def pointclick(self, event):
        self.inputAndresult.AppendText('.')

    def equilclick(self, event):
        expression=self.inputAndresult.Value
        self.inputAndresult.AppendText('='+str(eval(expression))+'\n')
    def deleteclick(self, event):
        self.inputAndresult.Clear()

    def addclick(self, event):
        self.inputAndresult.AppendText("+")

    def subtractclick(self, event):
        self.inputAndresult.AppendText('-')

    def multiplyclick(self, event):
        self.inputAndresult.AppendText('*')

    def divideclick(self, event):
        self.inputAndresult.AppendText('/')

    def leftdeleteclick( self, event ):
        a=self.inputAndresult.Value
        self.inputAndresult.Clear()
        a=a[:-1]
        self.inputAndresult.AppendText(a)


if __name__=='__main__':
    app=wx.App()
    fistFrame=myFrame(None)
    app.MainLoop()